//#version 120
uniform mat4 u_MVPMatrix;
uniform mat4 u_ViewMatrix;

attribute vec4 a_Position;
attribute vec4 a_Color;
attribute vec3 a_Normal;
attribute vec2 a_TextureCoordinate;

varying vec3 v_Position;
varying vec4 v_Color;
varying vec3 v_Normal;
varying vec2 v_TextureCoordinate;

void main() {

    //传递顶点到眼睛的位置
    v_Position = vec3(u_ViewMatrix * a_Position);
    v_Color  = a_Color;
    v_TextureCoordinate = a_TextureCoordinate;
    v_Normal = vec3(u_ViewMatrix * vec4(a_Normal,0.0));
    gl_Position = u_MVPMatrix * a_Position;

}
